<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>欢迎光临 Music Store</title>
<link type="text/css" rel="Stylesheet"
	href="${pageContext.request.contextPath }/style/front.css" />
	<script src="${pageContext.request.contextPath}/script/jquery-1.10.2.js"></script>

<style>
.goods thead {
	font-weight: bold;
}

.goods {
	text-align: center;
	width: 500px;
	margin: 0px auto;
}

.goods td {
	width: 80px;
	background-color: #f4f4f4;
	padding: 2px 0px;
}

.goods .sp {
	width: 200px;
}

.order {
	margin: 10px 40px;
}

.order td {
	padding: 2px 7px;
}

input[type=text] {
	width: 300px;
}
</style>
</head>
<body>
	<div id="wrapper">
		<s:action name="header" executeResult="true" namespace="/"></s:action>
		<div id="content">
			<s:action name="sidebar" executeResult="true" namespace="/"></s:action>
			<div id="main">
				<h3 id="main-title">订单明细</h3>
				<table class="goods">
					<thead>
						<tr>
							<td class="sp">唱片</td>
							<td>单价</td>
							<td>数量</td>
							<td>小计</td>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${cart.items }" var="i">
							<tr>
								<td class="sp">${i.title }</td>
								<td>￥${i.unitPrice }</td>
								<td>${i.quantity }</td>
								<td>￥${i.getSubTotal() }</td>
							</tr>
						</c:forEach>
						<tr>
							<td class="sp"></td>
							<td></td>
							<td>合计</td>
							<td>￥${cart.getTotal() }</td>
						</tr>
					</tbody>
				</table>
			</div>
			<div id="main">
				<h3 id="main-title">收货人信息</h3>
				<form action="orderConfirm" method="post" id="form">
					<input type="hidden" value="${user.username }" name="order.username" /> 
					<table class="order">
						<tr>
							<td>收货人:</td>
							<td><input type="text" name="order.consignee"
								value="${user.name }" /></td>
						</tr>
						<tr>
							<td>联系地址:</td>
							<td><input type="text" name="order.address"
								value="${user.address }" /></td>
						</tr>
						<tr>
							<td>联系电话:</td>
							<td><input type="text" name="order.phone"
								value="${user.phone }" /></td>
						</tr>
						<tr>
							<td>Email:</td>
							<td><input type="text" name="order.email"
								value="${user.email }" /></td>
						</tr>
						<tr>
							<td></td>
							<td><input type="submit" value="确认购买" /></td>
						</tr>
					</table>
				</form>
			</div>
			<div class="clearBoth"></div>
		</div>
		<%@ include file="../shared/footer.jsp"%>
	</div>
</body>
</html>
